#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include<string>
using namespace std;

long long an(long k)
{
    long long a1 = 1;
    long long a2 = 2;
    long long an = 0;
    if (k == 1)
    {
        return 1;
    }
    else if (k == 2)
    {
        return 2;
    }
    for (int i = k - 2; i > 0; i--)
    {
        an = 2 * a2 + a1;
        a1 = a2;
        a2 = an;
    }
    return an;
}
int main2() {

    long long arr[1000000] = { 1,2 };
    for (int i = 2; i < 1000000; i++)
    {
        arr[i] = (2 * arr[i - 1] + arr[i - 2]) % 32767;
    }
    int n;
    int k;
    cin >> n;
    while (n)
    {
        cin >> k;
        cout << arr[k - 1] << endl;
        n--;
    }
    return 0;
}
int main1() {
    int n;
    int k;
    cin >> n;
    while (n > 0)
    {
        cin >> k;
        cout << an(k) % 32767 << endl;
        n--;
    }
    cout << an(8);
    return 0;
}

int main() {
    string str;
    getline(cin, str);
    int s = 0;
    int number = 0;
    int k = 0;
    int q = 0;
    for (int i = 0; i < str.length(); i++)
    {
        if (str[i] == ' ')
        {
            k++;
        }
        else if ((str[i] >= 'a' && str[i] <= 'z') || (str[i] >= 'A' && str[i] <= 'Z'))
        {
            s++;
        }
        else if (str[i] >= '0' && str[i] <= '9')
        {
            number++;
        }
        else
        {
            q++;
        }
    }
    cout << s << endl;
    cout << k << endl;
    cout << number << endl;
    cout << q << endl;
    return 0;
}